<center>
<LINK REL=StyleSheet HREF="../css/headerstyle.css" TYPE="text/css" MEDIA=screen>
<div class="change">
<body bgcolor="#8f7696">
<?php
session_start();
require_once('../class/member.php');

echo '<form action="#" method="post">
Current Password:<br>
<input type="password" name="current"><br><br>
New Password:<br>
<input type="password" name="new"><br><br>
Re-type Password:<br>
<input type="password" name="new2"><br><br>

<input type="submit" value="Change Password">
</form>';

if(!isset($_POST['current'])||!isset($_POST['new'])||!isset($_POST['new2'])){
    $_POST['current'] = "";
    $_POST['new'] = "";
    $_POST['new2'] = "";
}

if($_POST['new']==$_POST['new2']){
$password = $_POST['new'];

$member = new member;

if($member->changePass($_POST['current'],$password,$_SESSION['username']) != $_POST['current']){
    echo "Your Password has been changed :)</br>";
   
}else {
    
}



}else{
    echo "Password does not match!</br>";
}
?>
<a href="../index.php"> Back to Index </a>
</div>